home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 52
/
Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso
/
Aminet
/
demo
/
intro
/
3D-Boing.lha
/
3d-boing
/
My_Begin.s
< prev
next >
Wrap
Text File
|
2002-08-16
|
4KB
|
210 lines
* output dh1:dev/devpac/rts
incdir dh1:dev/devpac/include
TRUE: = -1
FALSE: = 0
* exec.library
include lvo/exec_lib.i
include exec/exec.i
CALLEXE macro
move.l 4.w,a6
jsr _LVO\1(a6)
endm
* dos.library
include lvo/dos_lib.i
MODE_OLDFILE: = 1005
MODE_NEWFILE: = 1006
CALLDOS macro
move.l DosBase,a6
jsr _LVO\1(a6)
endm
DOSNAME macro
DosName: dc.b 'dos.library',0
endm
* intuition.library
include intuition/iobsolete.i
include lvo/intuition_lib.i
CALLINT macro
move.l IntBase,a6
jsr _LVO\1(a6)
endm
INTNAME macro
IntName: dc.b 'intuition.library',0
endm
* asl.library
include lvo/asl_lib.i
include libraries/asl.i
CALLASL macro
move.l AslBase,a6
jsr _LVO\1(a6)
endm
ASLNAME macro
AslName: dc.b 'asl.library',0
endm
* gadtools.library
include lvo/gadtools_lib.i
include libraries/gadtools.i
CALLGT macro
move.l GTBase,a6
jsr _LVO\1(a6)
endm
GTNAME macro
GTName: dc.b 'gadtools.library',0
endm
* graphics.library
include lvo/graphics_lib.i
CALLGFX macro
move.l GfxBase,a6
jsr _LVO\1(a6)
endm
GFXNAME macro
GfxName: dc.b 'graphics.library',0
endm
* rtgmaster.library
include lvo/rtgmaster_lib.i
CALLRTG macro
move.l RtgMasterBase,a6
jsr _LVO\1(a6)
endm
RTGNAME macro
RtgName: dc.b 'rtgmaster.library',0
endm
* hardware
* Ïîðò äæîéñòèêà/ìûøè 1 (R)
joy0dat: =$DFF00A
* Ïîðò äæîéñòèêà/ìûøè 2 (R)
joy1dat: =$DFF00C
* Ñîñòîÿíèå êíîïîê äæîéñòèêà/ìûøè 1 (áèò 7) è 2 (áèò 6) (R)
ciagameport: =$bfe001
* Ñûðîé êîä íàæàòîé êëàâèøè (R)
ciasdr: =$bfec01
* Ðåãèñòð óïðàâëåíèÿ DMA (R)
dmaconr: =$DFF002
* Ðåãèñòð óïðàâëåíèÿ DMA (W)
dmacon: =$DFF096
* Ðåãèñòð ðåæèìîâ ðàáîòû àóäèî-êàíàëîâ (W)
adkcon: =$DFF09E
* Àóäèî-êàíàë 0
* Ðåãèñòð íà÷àëà òàáëèöû äàííûõ, áèòû 16-18 (W)
aud0ptr: =$DFF0A0
* Ðåãèñòð íà÷àëà òàáëèöû äàííûõ, áèòû 0-15 (W)
aud0ptrl: =$DFF0A2
* Ðåãèñòð ðàçìåðà òàáëèöû äàííûõ (W)
aud0len: =$DFF0A4
* Ðåãèñòð ïåðèîäà âûáîðêè äàííûõ (W)
aud0per: =$DFF0A6
* Ðåãèñòð ãðîìêîñòè (W)
aud0vol: =$DFF0A8
* Ðåãèñòð (áóôåð) äàííûõ (W)
aud0dat: =$DFF0AA
* Àóäèî-êàíàë 1
* Ðåãèñòð íà÷àëà òàáëèöû äàííûõ, áèòû 16-18 (W)
aud1ptr: =$DFF0B0
* Ðåãèñòð íà÷àëà òàáëèöû äàííûõ, áèòû 0-15 (W)
aud1ptrl: =$DFF0B2
* Ðåãèñòð ðàçìåðà òàáëèöû äàííûõ (W)
aud1len: =$DFF0B4
* Ðåãèñòð ïåðèîäà âûáîðêè äàííûõ (W)
aud1per: =$DFF0B6
* Ðåãèñòð ãðîìêîñòè (W)
aud1vol: =$DFF0B8
* Ðåãèñòð (áóôåð) äàííûõ (W)
aud1dat: =$DFF0BA
* Àóäèî-êàíàë 2
* Ðåãèñòð íà÷àëà òàáëèöû äàííûõ, áèòû 16-18 (W)
aud2ptr: =$DFF0C0
* Ðåãèñòð íà÷àëà òàáëèöû äàííûõ, áèòû 0-15 (W)
aud2ptrl: =$DFF0C2
* Ðèãèñòð ðàçìåðà òàáëèöû äàííûõ (W)
aud2len: =$DFF0C4
* Ðåãèñòð ïåðèîäà âûáîðêè äàííûõ (W)
aud2per: =$DFF0C6
* Ðåãèñòð ãðîìêîñòè (W)
aud2vol: =$DFF0C8
* Ðåãèñòð (áóôåð) äàííûõ (W)
aud2dat: =$DFF0CA
* Àóäèî-êàíàë 3
* Ðåãèñòð íà÷àëà òàáëèöû äàííûõ, áèòû 16-18 (W)
aud3ptr: =$DFF0D0
* Ðåãèñòð íà÷àëà òàáëèöû äàííûõ, áèòû 0-15 (W)
aud3ptrl: =$DFF0D2
* Ðåãèñòð ðàçìåðà òàáëèöû äàííûõ (W)
aud3len: =$DFF0D4
* Ðåãèñòð ïåðèîäà âûáîðêè äàííûõ (W)
aud3per: =$DFF0D6
* Ðåãèñòð ãðîìêîñòè (W)
aud3vol: =$DFF0D8
* Ðåãèñòð (áóôåð) äàííûõ (W)
aud3dat: =$DFF0DA
INIT: MACRO
pr_CLI: =$ac
pr_MsgPort: =$5c
movem.l d0/a0,-(sp) ;ñîõðàíÿåì íà÷àëüíûå ïåðåìåííûå
clr.l returnmsg
sub.l a1,a1
CALLEXE FindTask ;èùåì íàñ
move.l d0,a4
tst.l pr_CLI(a4)
beq.s fromworkbench
;èû áûëè âûçâàíû èç CLI
movem.l (sp)+,d0/a0 ;âîññòaíàâëèâàåì ðåãèñòðû
bra.s end_startup ;è çàïóñêàåì ïðîãðàììó ïîëüçîâàòåëÿ
;èû áûëè âûçâàíû èç Worckbench
fromworkbench:
lea pr_MsgPort(a4),a0
CALLEXE WaitPort ;æäåì ñîîáùåíèå
lea pr_MsgPort(a4),a0
CALLEXE GetMsg ;è ïîëó÷àåì åãî
move.l d0,returnmsg ;ñîõðàíèì åãî äëÿ äàëüíåéøåãî îòâåòà
movem.l (sp)+,d0/a0 ;âîññòaíàâëèâàåì íà÷àëüíûå ïåðåìåííûå
end_startup:
bsr.s main ;âûçûâàåì âàøó ïðîãðàììó
;âîçâðàò ñ êîäîì â d0
move.l d0,-(sp) ;ñîõðàíèì åãî
tst.l returnmsg
beq.s exittodos
CALLEXE Forbid
move.l returnmsg(pc),a1
CALLEXE ReplyMsg
exittodos:
move.l (sp)+,d0 ;âîññòaíàâëèâàåì êîä âîçâðàòà
rts
returnmsg: dc.l 0
ENDM
main: